package com.ruoyi.web.controller.teacher;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.ruoyi.domain.BasisRealSignal;
import com.ruoyi.service.IBasisRealSignalService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 真实模采信号Controller
 * 
 * @author wangzebing
 * @date 2025-03-27
 */
@RestController
@RequestMapping("/signal")
public class BasisRealSignalController extends BaseController
{
    @Autowired
    private IBasisRealSignalService basisRealSignalService;

    /**
     * 查询真实模采信号列表
     */
    @GetMapping("/list")
    public TableDataInfo list(BasisRealSignal basisRealSignal)
    {
        startPage();
        List<BasisRealSignal> list = basisRealSignalService.selectBasisRealSignalList(basisRealSignal);
        return getDataTable(list);
    }

    /**
     * 导出真实模采信号列表
     */
    @Log(title = "真实模采信号", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, BasisRealSignal basisRealSignal)
    {
        List<BasisRealSignal> list = basisRealSignalService.selectBasisRealSignalList(basisRealSignal);
        ExcelUtil<BasisRealSignal> util = new ExcelUtil<BasisRealSignal>(BasisRealSignal.class);
        util.exportExcel(response, list, "真实模采信号数据");
    }

    /**
     * 获取真实模采信号详细信息
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(basisRealSignalService.selectBasisRealSignalById(id));
    }

    /**
     * 新增真实模采信号
     */
    @Log(title = "真实模采信号", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody BasisRealSignal basisRealSignal)
    {
        return toAjax(basisRealSignalService.insertBasisRealSignal(basisRealSignal));
    }

    /**
     * 修改真实模采信号
     */
    @Log(title = "真实模采信号", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody BasisRealSignal basisRealSignal)
    {
        return toAjax(basisRealSignalService.updateBasisRealSignal(basisRealSignal));
    }

    /**
     * 删除真实模采信号
     */
    @Log(title = "真实模采信号", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(basisRealSignalService.deleteBasisRealSignalByIds(ids));
    }
}
